package realm.inorder.itmill.ui.panel.logged.cadastro;

import org.springframework.beans.factory.annotation.Autowired;

import realm.inorder.itmill.components.AbstractPanel;
import realm.inorder.itmill.ui.menu.MenuBuilder;
import realm.inorder.itmill.ui.menu.MenuOption;
import realm.inorder.itmill.ui.menu.MenuPanel;
import realm.inorder.itmill.ui.menu.SimpleMenuOption;
import realm.inorder.itmill.ui.panel.logged.LoggedLayoutController;

import com.itmill.toolkit.ui.Layout;
import com.itmill.toolkit.ui.Button.ClickEvent;

public abstract class AbstractLoggedContentPanel extends AbstractPanel implements MenuBuilder {

	@Autowired
	protected LoggedLayoutController loggedLayoutController;


	protected MenuOption clientesMenuOption = new SimpleMenuOption("Clientes *") {
		@Override
		public void performAction(ClickEvent clickEvent) {
			// TODO abrir tela de cadastro de cliente limpa
			loggedLayoutController.showClienteConsultaPanel();
		}
	};

	protected MenuOption logoutMenuOption = new SimpleMenuOption("Logout *") {
		@Override
		public void performAction(ClickEvent clickEvent) {
			// TODO fazer logout
		}
	};

	public AbstractLoggedContentPanel() {
		super();
	}

	public AbstractLoggedContentPanel(Layout layout) {
		super(layout);
	}

	public AbstractLoggedContentPanel(String caption, Layout layout) {
		super(caption, layout);
	}

	public AbstractLoggedContentPanel(String caption) {
		super(caption);
	}

	public void makeMenu(MenuPanel menuPanel) {
		menuPanel.addMenuOption(logoutMenuOption);
	}

}
